<template>
  <div>
    <!--    测试selector-->
    <button @click="choose(type.select)">selector</button>
    <button @click="choose(type.calendar)">calendar</button>
    <component :is="component" />
  </div>
</template>
<script setup lang="ts">
import TestSelector from './components/TestSelector.vue'
import TestCalendar from './components/TestCalendar.vue'
import { shallowRef } from 'vue'
enum type {
  select,
  calendar,
}
const components = new Map()
components.set(type.select, TestSelector)
components.set(type.calendar, TestCalendar)
const component = shallowRef(components.get(type.select))
const choose = (e: type) => {
  component.value = components.get(e)
}
</script>
